//
//  NewFukuanmaViewController.m
//  wangzhe
//
//  Created by 李 佳伟 on 2018/3/15.
//  Copyright © 2018年 李 佳伟. All rights reserved.
//

#import "NewFukuanmaViewController.h"
#import "JTCSM.h"

@interface NewFukuanmaViewController ()<UINavigationControllerDelegate>
{
    UILabel *_label;
    UIImageView *erweimaIamgeV;
    UIImageView *tiaoxingMaImageV;
    UILabel *tiaoxingmaNumberlabel;
    CGFloat backviewWidth;
    CGFloat iamgeviewsize;
    CGFloat viewspace ;
    CGFloat labelheight;
    CGFloat imagesize ;
    CGFloat tiaoxingmaHeight ;
}
@property (nonatomic,strong) UIView *backview;
@property (nonatomic,strong) UILabel *moneyLabel;
@property (nonatomic,strong) UIButton *saoyisaoButton;
@property (nonatomic,strong) UIButton *fukuanmaButton;
@end

@implementation NewFukuanmaViewController

- (void)gotobackVC{
    [self.navigationController popViewControllerAnimated:YES];
}
// 将要显示控制器
- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated {
    // 判断要显示的控制器是否是自己
    BOOL isShowHomePage = [viewController isKindOfClass:[self class]];
    
    [self.navigationController setNavigationBarHidden:isShowHomePage animated:YES];
}
- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.view.backgroundColor = [df colorWithHexString:@"3b5369" alpha:1];
    self.navigationController.delegate = self;
    [df isRemoveTarbar:YES];
    _label = [UILabel initWithFrame:CGRectMake(0, 20, KSCREENWidth, 44) text:@"付款码" font:22 textAlignment:NSTextAlignmentCenter texcolor:[UIColor whiteColor] backgroundColor:[UIColor clearColor]];
    [self.view addSubview:_label];
    
    UIButton *button = [[UIButton alloc] init];
    button.frame = CGRectMake(20, 20, 60, 44);
    [button setImage:[UIImage imageNamed:@"erweimafanhui.png"] forState:UIControlStateNormal];
    button.imageEdgeInsets = UIEdgeInsetsMake(12.5, 5, 12.5, 40);
    button.titleEdgeInsets = UIEdgeInsetsMake(0, -30, 0, 0);
    [button addTarget:self action:@selector(gotobackVC) forControlEvents:UIControlEventTouchUpInside];
    [button setTitleColor:RGBACOLOR(51, 51, 51, 1) forState:UIControlStateNormal];
    [self.view addSubview:button];
    
    [self layoutSubeview];
    
}
- (void)layoutSubeview{
    viewspace = 20;
    backviewWidth =KCONTROLLERWith-2*viewspace;
    iamgeviewsize = 460*[JTCSMSingle shareSingle].adaptationNumber;
    labelheight = 50*[JTCSMSingle shareSingle].adaptationNumber;
    imagesize = 172*[JTCSMSingle shareSingle].adaptationNumber;
    tiaoxingmaHeight = 66*[JTCSMSingle shareSingle].adaptationNumber;
    _backview = [[UIView alloc]initWithFrame:CGRectMake(viewspace, 80, backviewWidth, iamgeviewsize)];
    _backview.backgroundColor = [UIColor whiteColor];
    _backview.userInteractionEnabled = YES;
    [self.view addSubview:_backview];
    [df layerWithView:_backview radius:5 width:0 color:nil];
    
    //    [df setTheViewYiYing:backview shadowColor:RGBACOLOR(89, 89, 89, 1) shadowOffset:CGSizeMake(3, 3) apla:.5];
    
    UIView *headerView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, _backview.LC_width, labelheight)];
    headerView.backgroundColor = RGBACOLOR(241, 241, 241, 1);
    [_backview addSubview:headerView];
    CGFloat headerimagesize = 15;
    UIImageView *imageview = [[UIImageView alloc]initWithFrame:CGRectMake(10, (labelheight-headerimagesize)/2, headerimagesize, headerimagesize)];
    imageview.image = [UIImage imageNamed:@"商家付款Title.png"];
    [_backview addSubview:imageview];
    
    UILabel *titleLabel = [UILabel initWithFrame:CGRectMake(KVIEW_X(imageview)+10, 0, backviewWidth, labelheight) text:@"向商家付款" font:14 textAlignment:NSTextAlignmentLeft texcolor:RGBACOLOR(51, 51, 51, 1) backgroundColor:nil];
    [headerView addSubview:titleLabel];
    
    tiaoxingMaImageV = [[UIImageView alloc]initWithFrame:CGRectMake(viewspace,labelheight+20, _backview.LC_width-2*viewspace, tiaoxingmaHeight)];
    tiaoxingMaImageV.image = [UIImage  imageNamed:@"tiaoxingma.png"];
    [_backview addSubview:tiaoxingMaImageV];
    
    CGRect rect = [df labelHeightWithContent:@"测试数据" width:_backview.LC_width font:14];
    tiaoxingmaNumberlabel = [UILabel initWithFrame:CGRectMake(0, KVIEW_Y(tiaoxingMaImageV)+13, _backview.LC_width, rect.size.height) text:@"2930*******查看数据" font:14 textAlignment:NSTextAlignmentCenter texcolor:[df colorWithHexString:@"999999" alpha:1] backgroundColor:nil];
    [_backview addSubview:tiaoxingmaNumberlabel];
    
    erweimaIamgeV = [[UIImageView alloc]initWithFrame:CGRectMake((backviewWidth-imagesize)/2, KVIEW_Y(tiaoxingMaImageV)+50, imagesize, imagesize)];
    erweimaIamgeV.image = [UIImage  imageNamed:@"erweima.jpg"];
    [_backview addSubview:erweimaIamgeV];
    
    UIView *bottomeView = [[UIView alloc]initWithFrame:CGRectMake(0, KVIEW_Y(erweimaIamgeV)+50-13-rect.size.height, _backview.LC_width, labelheight)];
    [df lineViewWithHeightofTop:bottomeView.LC_y superView:_backview spacing:0 color:RGBACOLOR(241, 241, 241, 1) lineHeight:1];
    [_backview addSubview:bottomeView];
    _backview.frame = CGRectMake(_backview.LC_x, _backview.LC_y, _backview.LC_width, KVIEW_Y(bottomeView));
    
    CGFloat bottomeImagesize = 15;
    UIImageView *bottomimageView = [[UIImageView alloc]initWithFrame:CGRectMake(18, (labelheight-bottomeImagesize)/2, bottomeImagesize, bottomeImagesize)];
    bottomimageView.image = [UIImage imageNamed:@"钱包icon.png"];
    [bottomeView addSubview:bottomimageView];
    NSString *str = @"钱包余额";
    CGRect bottomerect = [df labelHeightWithContent:str width:1000 font:14];
    UILabel *bottomeTitleLabel = [UILabel initWithFrame:CGRectMake(KVIEW_X(bottomimageView)+7, (labelheight-bottomerect.size.height)/2, bottomerect.size.width, bottomerect.size.height) text:str font:14 textAlignment:NSTextAlignmentCenter texcolor:[df colorWithHexString:@"666666" alpha:1] backgroundColor:nil];
    [bottomeView addSubview:bottomeTitleLabel];
    CGFloat eyeHeight = bottomeImagesize*0.5147;
    UIImageView *eyeimageView = [[UIImageView alloc]initWithFrame:CGRectMake(_backview.LC_width-18-bottomeImagesize, (labelheight-eyeHeight)/2, bottomeImagesize, eyeHeight)];
    eyeimageView.image = [UIImage imageNamed:@"睁眼睛.png"];
    [bottomeView addSubview:eyeimageView];
    
    self.moneyLabel = [UILabel initWithFrame:CGRectMake(_backview.LC_width-bottomeImagesize-18-7-200, 0, 200, labelheight) text:@"¥890.10" font:15 textAlignment:NSTextAlignmentRight texcolor:[df colorWithHexString:@"333333" alpha:1] backgroundColor:nil];
    [bottomeView addSubview:self.moneyLabel];
    
    CGFloat buttonsize = 60;
    
    CGFloat buttonSpace = (KCONTROLLERWith - buttonsize*2)/4;
    self.saoyisaoButton = [UIButton buttonWithType:UIButtonTypeCustom];
    self.saoyisaoButton.frame = CGRectMake(buttonSpace, KCONTROLLERHeight-150*[JTCSMSingle shareSingle].adaptationNumber, buttonsize, buttonsize);
    [self.saoyisaoButton setTitle:@"扫一扫" forState:UIControlStateNormal];
    self.saoyisaoButton.titleLabel.font = [UIFont systemFontOfSize:10];
    [self.saoyisaoButton setTitleColor:[df colorWithHexString:@"ffffff" alpha:0.5] forState:UIControlStateNormal];
    [self.saoyisaoButton setImage:[UIImage imageNamed:@"扫码.png"] forState:UIControlStateNormal];
    self.saoyisaoButton.imageEdgeInsets = UIEdgeInsetsMake(5, 15, 25, 15);
    self.saoyisaoButton.titleEdgeInsets = UIEdgeInsetsMake(40, -60, 0, 0);
    [self.view addSubview:self.saoyisaoButton];
    
    
    self.fukuanmaButton = [UIButton buttonWithType:UIButtonTypeCustom];
    self.fukuanmaButton.frame = CGRectMake(buttonSpace+KCONTROLLERWith/2, KCONTROLLERHeight-150*[JTCSMSingle shareSingle].adaptationNumber, buttonsize, buttonsize);
    [self.fukuanmaButton setTitle:@"付款码" forState:UIControlStateNormal];
    self.fukuanmaButton.titleLabel.font = [UIFont systemFontOfSize:10];
    [self.fukuanmaButton setTitleColor:[df colorWithHexString:@"ffffff" alpha:1] forState:UIControlStateNormal];
    [self.fukuanmaButton setImage:[UIImage imageNamed:@"付款码.png"] forState:UIControlStateNormal];
    self.fukuanmaButton.imageEdgeInsets = UIEdgeInsetsMake(5, 15, 25, 15);
    self.fukuanmaButton.titleEdgeInsets = UIEdgeInsetsMake(40, -60, 0, 0);
    [self.view addSubview:self.fukuanmaButton];
    
    
    
}

- (void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    self.navigationController.navigationBar.hidden = YES;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
